package com.glhtgyxy.biyesheji.Service;

import com.glhtgyxy.biyesheji.Mapper.userMapper;
import com.glhtgyxy.biyesheji.Pojo.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

import static com.glhtgyxy.biyesheji.Util.panduanshuzi.isNumeric;

@Service
public class userService {
    @Autowired
    private userMapper usermapper;

    public ArrayList<user> selectAllUser(){

        return usermapper.selectAllUser();
    }
    public Boolean deleteUser(int id){

        return usermapper.deleteUser(id)>0?true:false;
    }
    public Boolean updateUser(int id ,String name,String account , String password){

        return usermapper.updateUser(id,name,account,password)>0?true:false;
    }
    public Boolean addUser(String name,String account , String password){

        return usermapper.addUser(name,account,password)>0?true:false;
    }
    public ArrayList<user> findUser(String searchtext){
        System.out.println("开始模糊查找用户："+searchtext);
            return usermapper.findUser4(searchtext);
    }

}
